<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<input type="button"  value="v-on指令"  v-on:click="doIt"/>
			<input type="button"  value="v-on简写"  @click="doIt"/>
			<input type="button"  value="双击事件"  @dblclick="doIt"/>
			<h2 @click="changeFood">{{food}}</h2>
			
			
			
		</div>
		
		<script type="text/javascript">
			var app = new Vue({
				el: "#app",
				data: {
					message: "",
					food: "西兰花炒蛋"
				},
				methods:{
					doIt:function(){
						console.log("点击成功")
						alert("做程序员，IT");
					},
					
					changeFood:function(){
						console.log(this.food);
						this.food  += "好好吃!"
					}
				}
				
			})
		</script>
	</body>
</html>
